﻿using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Diagnostics;
using System.Collections;

using Ninject.Modules;
using Ninject;

using System.Net.DnsToolkit.Packet;
using System.Net.DnsToolkit.Packet.Records;
using System.Net.DnsToolkit.Configuration;
using System.Net.DnsToolkit.Serializer;

namespace System.Net.DnsToolkit.TestUnit.Helper {

    public static class DnsWriter {


        static readonly IMessageWriter<System.IO.Stream> _writer;
        static DnsWriter() {

            var dsr = new DnsWriterStreamModule();
            IKernel kernel = new StandardKernel(dsr);
            _writer = kernel.Get<IMessageWriter<System.IO.Stream>>();
        }

        public static void Write(System.IO.Stream stream, IMessage message) {
            Write(stream, message, true);
        }

        public static void Write(System.IO.Stream stream, IMessage message, bool useCompression) {
            _writer.Write(stream, message, useCompression);
        }

    }

}
